takePicture

suspend fun ScanScreenState.takePicture(outputFile: File)

Takes a picture and writes its JPEG bytes to outputFile.

Existing file contents are replaced. File I/O is performed on Dispatchers.IO.

Throws

If the state is not attached to a screen, the camera is not ready, or another capture is already in progress.